import com.adam.pojo.Books;
import com.adam.service.BookService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test {

    @Test
    public void test1(){
      ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookService bookServiceImpl = context.getBean("BookServiceImpl", BookService.class);
        List<Books> java = bookServiceImpl.searchBook("Java");
        for (Books book : java) {
            System.out.println(book);
        }
    }
}
